﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.Mvc;
using IndyMosaic.Models.Web;

namespace IndyMosaic.Org.Site.Controllers
{
    [HandleError]
    public class HomeController : Controller
    {
        public INewsItemRepository repository { get; set; }
        public IMediaRepository mediaRepository { get; set; }
        public HomeController()
            :this(new NewsItemRepository(), new MediaRepository())
        {}

        public HomeController(INewsItemRepository repository, IMediaRepository media)
        {
            this.repository = repository;
            this.mediaRepository = media;
        }
        public ActionResult Index()
        {
            IndyMosaic.Org.Site.ViewData.Home.IndexData data = new ViewData.Home.IndexData();
            data.LiveStreamOn = mediaRepository.ShowingLiveStream();
            data.NewsItems = repository.GetNewsItemsForToday();

            return View(data);
        }
        public ActionResult About()
        {
            return View();
        }
        public ActionResult Visit()
        {
            return View();
        }
        public ActionResult Staff()
        {
            return View();
        }
        public ActionResult OurStory()
        {
            return View();
        }
    }
}
